/**
 * Created by Yu Jin Xian on 2016/11/29.
 */
module.exports = function (grunt) {
    // 加载插件
    [
        'grunt-cafe-mocha',
        'grunt-contrib-jshint',
        'grunt-exec'
    ].forEach(function (item) {
        grunt.loadNpmTasks(item);
    });

    // 配置插件
    grunt.initConfig({
        cafemocha: {
            all: {src: 'qa/tests-*.js', options: {ui: 'tdd'}}
        },
        jshint: {
            app: ['meadowlark.js', 'public/js/**/*.js', 'lib/**/*.js'],
            qa: ['gruntfile.js', 'public/qa/**/*.js', 'qa/**/*.js']
        },
        exec: {
            linkchecker: {cmd: 'linkcheck http://localhost:3000'}
        }
    });

    // 注册任务
    grunt.registerTask('default', ['cafemocha', 'jshint', 'exec']);
};